<?php
/*
mysql API
从php API生成，或用户手动输入的数据储存进mysql
*/
?>
<!DOCTYPE HTML>
<html>
<head>
<script src="http://cdn.amazeui.org/amazeui/2.6.1/js/amazeui.min.js"></script>
<link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.6.1/css/amazeui.min.css">
<link rel="stylesheet" href="./php2sql.css">
</head>
<?php require_once "db_config.php";
$sql0 = "select * from ".$mysql_table; 
$result0 = mysql_query( $sql0, $conn );
$prelength = mysql_num_rows( $result0 );
echo $prelength;
for ( $i = 1; $i <= $prelength; $i++ ) {
	$sql = "select * from ".$mysql_table." where id=".$i;
	$result = mysql_query( $sql, $conn );
	if ( !$result ) {
		echo "无法获取数据!";
	}
	else {
		mysql_fetch_row($result);
	}
}
?>
<body>
	<table class="am-table">
		<thead>
			<tr>
				<th>ID</th>
				<th>中文名</th>
				<th>英文名</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>Amaze UI</td>
				<td>http://amazeui.org</td>
				<td>2012-10-01</td>
			</tr>
			<tr>
				<td>Amaze UI</td>
				<td>http://amazeui.org</td>
				<td>2012-10-01</td>
			</tr>
			<tr class="am-active">
				<td>Amaze UI(Active)</td>
				<td>http://amazeui.org</td>
				<td>2012-10-01</td>
			</tr>
			<tr>
				<td>Amaze UI</td>
				<td>http://amazeui.org</td>
				<td>2012-10-01</td>
			</tr>
			<tr>
				<td>Amaze UI</td>
				<td>http://amazeui.org</td>
				<td>2012-10-01</td>
			</tr>
		</tbody>
	</table>
</body>
</html>





